<?php
/**
 * Created by PhpStorm.
 * User: xzw
 * Date: 2018/7/27
 * Time: 15:09
 */
header("Access-Control-Allow-Origin:*");
header("Content-Type:application/json;charset=utf-8");
include "config.php";

if($_SERVER["REQUEST_METHOD"] == "POST" && !empty($_REQUEST["phoneNumber"])){
    $phoneNumber = $_REQUEST["phoneNumber"];

    //1.准备sql语句
    $querySql = "SELECT*FROM zols WHERE phoneNumber=?";
    //2.预处理
    $stmt = $conn->prepare($querySql);
    $stmt->bind_param("s", $phoneNumber);
    $stmt->execute();
    $result = $stmt->get_result();
    if( $result->num_rows>=1){
        //存在就返回fasle
        print_r("false");
    }else{
        print_r("true");
        //不存在就返回true
    }
}